<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <title>{$SETTING.website_name}</title>
  {include file="../Common/cssjs"}
</head>

<body class="hold-transition sidebar-mini">
  <div class="wrapper"> {include file="../Common/navbar"}

    {include file="../Common/sidebar"}

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">

      <!-- Main content -->
      <section class="content">

        <!-- Default box -->
        <div class="card card-primary">
          <div class="card-header">
            <h3 class="card-title">会员列表</h3>
          </div>
          <div class="card-body p-0">
            <form action="" method="get">
              <table class="table table-bordered">
                <tr>
                  <td>
                    <div class="input-group mb-3">
                      <div class="input-group-prepend">
                        <span class="input-group-text">ID</span>
                      </div>
                      <input type="text" name="userid" class="" placeholder="" value="{$userid}">
                      &nbsp;
                      <div class="input-group-prepend">
                        <span class="input-group-text">账号</span>
                      </div>
                      <input type="text" name="username" class="" placeholder="" value="{$username}">
                      &nbsp;
                      <div class="input-group-prepend">
                        <span class="input-group-text">所属组</span>
                      </div>
                      <select class="" name="groupid">
                          <option value="0">请选择</option>
                          {foreach \core_enums::$member_group as $k=>$v}
                          <option value="{$k}" {if $groupid==$k}selected{/if}>{$v}</option>
                          {/foreach}
                      </select>
                      &nbsp;
                      <div class="input-group-prepend">
                        <span class="input-group-text">真实姓名</span>
                      </div>
                      <input type="text" name="truename" class="" placeholder="" value="{$truename}">
                      &nbsp;
                      <button name="submit" type="submit" class="btn btn-primary">搜索</button>
                      &nbsp;
                      <button type="button" class="btn btn-warning" onclick="location.href='/member/lst';">重置</button>
                    </div>

                  </td>
                </tr>
              </table>
            </form>
            
            <table class="table table-bordered">
              {if count($data)}
              <thead>
                <tr>
                  <th>ID</th>
                  <th>账号</th>
                  <th>所属组</th>
                  <th>真实姓名</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                {foreach $data as $k=>$v}
                <tr>
                  <td>{$v.userid}</td>
                  <td>{$v.username}</td>
                  <td>{:myswitch($v.groupid,\core_enums::$member_group)}</td>
                  <td>{$v.truename}</td>
                  <td>
                      <a class="btn btn-warning btn-sm" href="/member/authenticate?userid={$v.userid}"> <i class="fas fa-lock">
                        </i> 权限 </a>
                    <a class="btn btn-info btn-sm" href="/member/mod?userid={$v.userid}"> <i class="fas fa-pencil-alt">
                      </i> 编辑 </a>
                    <a onclick="return confirm('确定要禁用么？');" class="btn btn-danger btn-sm" href="/member/del?userid={$v.userid}"> <i class="fas fa-trash">
                      </i> 禁用 </a>
                  </td>
                </tr>
                {/foreach}
                <tr>
                  <td colspan="100">
                    {$pager|raw}
                  </td>
                </tr>
                {else}
                <tr>
                  <td colspan="100">暂无数据</td>
                </tr>
                {/if}
              </tbody>
            </table>
          </div>
          <!-- /.card-body -->
        </div>
        <!-- /.card -->

      </section>
      <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
      <!-- Control sidebar content goes here -->
      <div class="p-3">
        <h5>Title</h5>
        <p>Sidebar content</p>
      </div>
    </aside>
    <!-- /.control-sidebar -->

    {include file="../Common/footer"}
  </div>
</body>

</html>